package com.vayne.bean;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @author xuerui.zhang
 * @since 2020/1/6 下午4:52
 */
public class Course {

    private static AtomicLong aId = new AtomicLong(10);

    private Long id;
    private String subject;
    private String desc;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "Course{" +
                "id=" + id +
                ", subject='" + subject + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }

    public static Course creteCourse() {
        Course course = new Course();
        course.setId(aId.getAndIncrement());
        return course;
    }
}
